API Endpoints
1. Create Short URL
Method: POST
Path: /su
Authentication: Yes
Description: Creates a shortened version of the original URL. Returns the short URL.
Request Body:
{
"originalUrl": "https://example.com/very/long/path"
}
Response:
{
"shortUrl": "https://your-domain.com/su/Ab12XyZ9"
}
2. Redirect to Original URL
Method: GET
Path: /su/:shortCode
Authentication: No
Description: Redirects the client to the original URL that corresponds to the given short code.
Example URL:
GET /su/Ab12XyZ9
Response:
- 302 Found with a redirection to the original URL.
- 404 Not Found if the short code does not exist.